#ifndef ARRAY_H
#define ARRAY_H

#define array_length(array) array->len
#define array_size(array) array->size

struct array {
	void *array;		/* variable pointing to the beginning of array */
	unsigned long long len;	/* array length */
	unsigned long long cap;	/* array capacity */
	unsigned long long size;	/* size of each element */
};

/* The prototypes of functions to manipulate array are declared as
   follows: */

struct array *array_new(unsigned long long capacity, unsigned long long size);
void *array_put(struct array *, const void *elem, unsigned long long index);
void *array_get(struct array *, unsigned long long index);
void *array_push(struct array *, const void *elem);
void array_free(struct array *);

#endif
